package edu.usm.roberge.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.HasData;

import edu.usm.roberge.shared.UsgaGolfCourse;

public class GolfCourseListView extends Composite {

	private static GolfCourseListViewUiBinder uiBinder = GWT
			.create(GolfCourseListViewUiBinder.class);

	interface GolfCourseListViewUiBinder extends
			UiBinder<Widget, GolfCourseListView> {
	}

	public GolfCourseListView() {
		initWidget(uiBinder.createAndBindUi(this));
		cellTable.addColumn(new TextColumn<UsgaGolfCourse>() {

			@Override
			public String getValue(UsgaGolfCourse object) {
				return object.getCourseName();
			}
			
		}, "Golf Course Name");
	}

	@UiField(provided=true) CellTable<UsgaGolfCourse> cellTable = new CellTable<UsgaGolfCourse>();

	public HasData<UsgaGolfCourse> getGolfCourseList() {
		return cellTable;
	}
}
